<%= form_for(@sensor) do |f| %>
  <% if @sensor.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@sensor.errors.count, "error") %> prohibited this sensor from being saved:</h2>

      <ul>
      <% @sensor.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <div class="field">
    <%= f.label :device_id %><br>
    <%= f.collection_select :device_id, Device.all, :id, :device_name %>    
  </div>

  <div class="field">
    <%= f.label :name %><br>
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :sensorType %><br>
    <%= f.number_field :sensorType %>
  </div>
  <div class="field">
    <%= f.label :sensorSign %><br>
    <%= f.number_field :sensorSign %>
  </div>
  <div class="field">
    <%= f.label :sensorUnit %><br>
    <%= f.text_field :sensorUnit %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
